package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.common.utils.BeanUtils;
import com.tianji.learning.domain.dto.QuestionFormDTO;
import com.tianji.learning.domain.po.InteractionQuestion;
import com.tianji.learning.domain.query.QuestionPageQuery;
import com.tianji.learning.domain.vo.QuestionVO;
import com.tianji.learning.service.IInteractionQuestionService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动提问的问题表 前端控制器
 * </p>
 *
 * @author author
 * @since 2025-03-26
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/questions")
public class InteractionQuestionController {

    private final IInteractionQuestionService interactionQuestionService;

    @GetMapping("/page")
    public PageDTO<QuestionVO> getPage(QuestionPageQuery questionPageQuery) {
        return interactionQuestionService.getPage(questionPageQuery);
    }

    // 返显示
    @GetMapping("/{id}")
    public QuestionVO getById(@PathVariable Long id) {
        return interactionQuestionService.getQuestionVo(id);
    }

    // 编辑按钮
    /**
     * 5、修改提问 （Day5 - 实战2）
     *
     * 前端有问题，自己用swagger测试
     * @param id
     * @param questionDTO
     */
    @ApiOperation("修改提问")
    @PutMapping("/{id}")
    public void updateQuestion(
            @ApiParam("要修改的问题的id") @PathVariable("id") Long id,
            @RequestBody QuestionFormDTO questionDTO) {
        //questionService.updateQuestion(id, questionDTO);
    }



}
